﻿using System.Configuration;

namespace Tilver.Configuration.Logging
{
    /// <summary>
    /// 日志分类配置节
    /// </summary>
    public class CategoryElement : ConfigurationElement
    {
        /// <summary>
        /// 配置节名称
        /// </summary>
        [ConfigurationProperty("name", IsRequired = true, IsKey = true)]
        public string Name
        {
            get { return (string)this["name"]; }
            set { this["name"] = value; }
        }
        /// <summary>
        /// 配置节是否可用
        /// </summary>
        [ConfigurationProperty("enabled", DefaultValue = true)]
        public bool Enabled
        {
            get { return (bool)this["enabled"]; }
            set { this["enabled"] = value; }
        }
        /// <summary>
        /// 是否使用线程池处理日志数据
        /// </summary>
        [ConfigurationProperty("useThreadPool", DefaultValue = true)]
        public bool UseThreadPool
        {
            get { return (bool)this["useThreadPool"]; }
            set { this["useThreadPool"] = value; }
        }

        /// <summary>
        /// 日志分类配置信息列表
        /// </summary>
        [ConfigurationProperty("appenders")]
        public AppenderCollection Appenders
        {
            get { return (AppenderCollection)this["appenders"]; }
            set { this["appenders"] = value; }
        }
    }
}
